<template>
  <div style="padding: 15px; background: rgb(253, 253, 253)">
    <!-- 码汇总数据上传窗口 -->
    <el-dialog
      title="上传"
      :visible.sync="uploadButtonSummary"
      width="30%"
      center
    >
      <el-form
        ref="elForm"
        :model="Summary"
        :rules="Summaryrules"
        size="medium"
        label-width="100px"
        label-position="left"
      >
        <el-form-item label="日期选择" prop="field104">
          <el-date-picker
            v-model="Summary.field104"
            format="yyyy-MM-dd"
            value-format="yyyy-MM-dd"
            :style="{ width: '100%' }"
            placeholder="请选择日期选择"
            clearable
          ></el-date-picker>
        </el-form-item>
        <el-form-item label="下拉选择" prop="field102">
          <el-select
            filterable
            v-model="Summary.field102"
            placeholder="请选择下拉选择"
            clearable
            :style="{ width: '100%' }"
          >
            <el-option
              v-for="(item, index) in Summaryptions"
              :key="index"
              :label="item.label"
              :value="item.value"
              :disabled="item.disabled"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="上传" prop="field103" required>
          <el-upload
            ref="field103"
            :file-list="field103fileList"
            :action="field103Action"
            :before-upload="field103BeforeUpload"
          >
            <el-button size="small" type="primary" icon="el-icon-upload"
              >点击上传</el-button
            >
          </el-upload>
        </el-form-item>
      </el-form>

      <span slot="footer" class="dialog-footer">
        <el-button @click="uploadButtonSummary = false">取 消</el-button>
        <el-button type="primary" @click="SummaryButton">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 脱敏数据转汇总窗口 -->
    <el-dialog
      title="转汇总"
      :visible.sync="TotalTransferShow"
      width="30%"
      center
    >
      <el-form
        ref="elForm"
        :model="TotalTransfer"
        :rules="TotalTransferrules"
        size="medium"
        label-width="130px"
        label-position="left"
      >
        <el-form-item label="展业日期" prop="field104">
          <el-input
            v-model="TotalTransfer.field101"
            clearable
            maxlength="20"
            :style="{ width: '100%' }"
          ></el-input>
        </el-form-item>
        <el-form-item label="系统ID" prop="field104">
          <el-input
            v-model="TotalTransfer.field102"
            clearable
            maxlength="20"
            :style="{ width: '100%' }"
          ></el-input>
        </el-form-item>
        <el-form-item label="识别名称" prop="field104">
          <el-input
            v-model="TotalTransfer.field103"
            clearable
            maxlength="20"
            :style="{ width: '100%' }"
          ></el-input>
        </el-form-item>
        <el-form-item label="识别号" prop="field104">
          <el-input
            v-model="TotalTransfer.field104"
            clearable
            maxlength="100"
            :style="{ width: '100%' }"
          ></el-input>
        </el-form-item>
        <el-form-item label="数据条数" prop="field104">
          <el-input
            maxlength="20"
            v-model="TotalTransfer.field105"
            clearable
            :style="{ width: '100%' }"
          ></el-input>
        </el-form-item>
        <el-form-item label="判断结果汇总" prop="field104">
          <el-input
            v-model="TotalTransfer.field106"
            clearable
            maxlength="20"
            :style="{ width: '100%' }"
          ></el-input>
        </el-form-item>
        <el-form-item label="计算结果百分比" prop="field104">
          <el-input
            maxlength="20"
            v-model="TotalTransfer.field107"
            clearable
            :style="{ width: '100%' }"
          ></el-input>
        </el-form-item>
      </el-form>

      <span slot="footer" class="dialog-footer">
        <el-button @click="TotalTransferShow = false">取 消</el-button>
        <el-button type="primary" @click="SummaryButton">发 布</el-button>
      </span>
    </el-dialog>
    <!-- 间联查看上级 弹窗 -->
    <el-dialog
      title="查看上级"
      :visible.sync="SuperiorShow"
      @click="onClose"
      center
    >
      <el-row :gutter="15">
        <!-- <div> -->
        <el-steps :active="CheckSuperiorNumber">
          <!-- //动态显示最后一个 -->
          <el-step
            v-for="item in CheckSuperiorData"
            :key="item.userId"
            :title="item.userName"
            :description="item.phoneNumber"
          ></el-step>
        </el-steps>
        <!-- </div> -->
      </el-row>
    </el-dialog>

    <!-- 划拨弹窗 -->
    <el-dialog
      title="划拨"
      :visible.sync="transferDialogVisible"
      width="30%"
      center
    >
      <el-form
        ref="transferData"
        :model="transferData"
        :rules="transferrules"
        size="medium"
        label-width="100px"
        label-position="left"
      >
        <el-form-item
          label="划拨层级"
          prop="field101"
          v-if="userName != '租户'"
        >
          <el-radio-group
            v-model="transferData.field101"
            @change="transferschange"
            size="medium"
          >
            <el-radio
              v-for="(item, index) in linkOptions"
              :key="index"
              :label="item.value"
              >{{ item.label }}</el-radio
            >
          </el-radio-group>
        </el-form-item>
        <el-form-item label="划拨用户" prop="field102">
          <el-select
            v-model="transferData.field102"
            placeholder="请选择划拨用户"
            clearable
            :style="{ width: '70%' }"
            size="small"
            filterable
          >
            <el-option
              v-for="(item, index) in transferOptions"
              :key="index"
              :label="item.nickName"
              :value="item.userId"
            ></el-option>
          </el-select>
        </el-form-item>
      </el-form>

      <span slot="footer" class="dialog-footer">
        <el-button @click="transferDialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="singletransfer">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 批量划拨弹窗 -->
    <el-dialog
      title="批量划拨"
      :visible.sync="drawingVisible"
      width="30%"
      center
    >
      <el-form
        ref="transferData"
        :model="transferData"
        :rules="transferrules"
        size="medium"
        label-width="80px"
        label-position="left"
      >
        <!-- <el-form-item label="划拨条数" prop="field101">
                  <el-input
                    v-model="transferData.field101"
                    placeholder="请输入批量打款条数"
                    :maxlength="15"
                    :disabled="true"
                    clearable
                    size="small"
                    :style="{ width: '70%' }"
                  ></el-input>
                </el-form-item> -->
        <el-form-item
          label="划拨层级"
          prop="field101"
          v-if="userName != '租户'"
        >
          <el-radio-group
            v-model="transferData.field101"
            @change="transferschange"
            size="medium"
          >
            <el-radio
              v-for="(item, index) in linkOptions"
              :key="index"
              :label="item.value"
              >{{ item.label }}</el-radio
            >
          </el-radio-group>
        </el-form-item>
        <el-form-item label="划拨用户" prop="field102">
          <el-select
            v-model="transferData.field102"
            placeholder="请选择划拨用户"
            clearable
            :style="{ width: '100%' }"
            size="small"
            filterable
          >
            <el-option
              v-for="(item, index) in transferOptions"
              :key="index"
              :label="item.nickName"
              :value="item.userId"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="上传" prop="field101" required>
          <el-upload
            ref="field106"
            class="upload-demo"
            :action="actionUrl()"
            :file-list="field102fileList"
            :on-change="handleChange2"
            :auto-upload="false"
            accept=".xlsx,.xls"
            :before-upload="field101BeforeUpload"
          >
            <el-button
              size="small"
              type="primary"
              icon="el-icon-upload"
              style="width: 100px"
              >点击上传</el-button
            >
          </el-upload>
        </el-form-item>
        <el-form-item label="下载模板">
          <el-button
            size="small"
            @click="downloadTemplate"
            type="primary"
            style="width: 100px"
            >点击下载</el-button
          >
        </el-form-item>
      </el-form>

      <span slot="footer" class="dialog-footer">
        <el-button @click="drawingVisible = false">取 消</el-button>
        <el-button
          :disabled="variable.length <= 0"
          type="primary"
          @click="transferClick"
          >确 定</el-button
        >
      </span>
    </el-dialog>

    <!-- 批量回收弹窗 -->
    <el-dialog
      title="批量回收"
      :visible.sync="recoveryVisible"
      width="30%"
      center
    >
      <el-form
        ref="recoveryData"
        :model="recoveryData"
        :rules="recoveryrules"
        size="medium"
        label-width="100px"
      >
        <el-form-item label="上传" prop="field101" required>
          <el-upload
            ref="field101"
            class="upload-demo"
            :action="actionUrl()"
            :file-list="field105fileList"
            :on-change="handleChange2"
            :auto-upload="false"
            accept=".xlsx,.xls"
            :before-upload="field101BeforeUpload"
          >
            <el-button
              size="small"
              type="primary"
              icon="el-icon-upload"
              style="width: 100px"
              >点击上传</el-button
            >
          </el-upload>
        </el-form-item>
        <el-form-item label="下载模板">
          <el-button
            size="small"
            @click="downloadTemplate"
            type="primary"
            style="width: 100px"
            >点击下载</el-button
          >
        </el-form-item>
      </el-form>

      <span slot="footer" class="dialog-footer">
        <el-button @click="recoveryVisible = false">取 消</el-button>
        <el-button
          :disabled="variable.length <= 0"
          type="primary"
          @click="recoveryClick"
          >确 定</el-button
        >
      </span>
    </el-dialog>

    <!-- 新增弹窗 -->
    <el-dialog title="新增" :visible.sync="addDialogVisible" width="30%" center>
      <el-form
        ref="addrData"
        :model="addrData"
        :rules="addrDatarules"
        size="medium"
        label-width="100px"
        label-position="left"
        @submit.native.prevent
      >
        <el-form-item label="广告位名称" prop="field101">
          <el-input
            size="small"
            v-model.trim="addrData.field101"
            placeholder="请输入广告位名称"
            :maxlength="10"
            clearable
            style="width: 100%"
          ></el-input>
        </el-form-item>
      </el-form>

      <span slot="footer" class="dialog-footer">
        <el-button @click="addDialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="addClick">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 上传码弹窗 -->
    <el-dialog
      title="上传码"
      :visible.sync="uploadDialogVisible"
      width="30%"
      center
    >
      <el-form
        ref="uploadData"
        :model="uploadData"
        :rules="uploadrules"
        size="medium"
        label-width="100px"
        label-position="left"
      >
        <el-form-item label="上传" prop="field101" required>
          <el-upload
            ref="field106"
            class="upload-demo"
            :action="actionUrl()"
            :file-list="field101fileList"
            :on-change="handleChange"
            :auto-upload="false"
            accept=".xlsx,.xls"
            :before-upload="field101BeforeUpload"
          >
            <el-button
              size="small"
              type="primary"
              icon="el-icon-upload"
              style="width: 100px"
              >点击上传</el-button
            >
          </el-upload>
        </el-form-item>
        <el-form-item label="下载模板">
          <el-button
            size="small"
            @click="upltemplate"
            type="primary"
            style="width: 100px"
            >点击下载</el-button
          >
        </el-form-item>
      </el-form>
    </el-dialog>

    <!-- 快速新增弹窗 -->
    <el-dialog
      title="快速新增"
      :visible.sync="fastaddDialogVisible"
      width="30%"
      center
    >
      <el-form
        ref="fastaddrData"
        :model="fastaddrData"
        :rules="fastaddrDatarules"
        size="medium"
        label-width="130px"
        label-position="left"
        @submit.native.prevent
      >
        <el-form-item label="快速新增数量" prop="field101">
          <el-input
            v-model.trim="fastaddrData.field101"
            placeholder="请输入快速新增数量"
            :maxlength="3"
            size="small"
            clearable
            :style="{ width: '100%' }"
          ></el-input>
        </el-form-item>
      </el-form>

      <span slot="footer" class="dialog-footer">
        <el-button @click="fastaddDialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="fastaddClick">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 码设置编辑 -->
    <el-dialog title="编辑" :visible.sync="editVisible" width="30%" center>
      <el-form
        ref="editrData"
        :model="editrData"
        :rules="editrDatarules"
        size="medium"
        label-width="100px"
        label-position="left"
        @submit.native.prevent
      >
        <el-form-item :label="mashezhi[2].name" prop="field101">
          <el-input
            size="small"
            v-model.trim="editrData.field101"
            :placeholder="mashezhi[2].name"
            :maxlength="20"
            clearable
            :style="{ width: '100%' }"
          ></el-input>
        </el-form-item>
      </el-form>

      <span slot="footer" class="dialog-footer">
        <el-button @click="editVisible = false">取 消</el-button>
        <el-button type="primary" @click="editSubmitButton">确 定</el-button>
      </span>
    </el-dialog>

    <!-- <el-card> -->
    <div class="dBox">
      <div slot="header" style="padding-bottom: 2px">
        <span style="display: flex; align-items: center; font-size: 18px">
          <img
            src="@/assets/img/shujuzhanshi.png"
            style="height: 20px; width: 20px; margin-right: 5px"
          />
          数据展示</span
        >
      </div>
      <div class="xhxBox"></div>
      <el-tabs
        v-model="activeName"
        @tab-click="handleClick"
        v-loading="loading"
        style="margin-top: 20px"
      >
        <!-- 码设置 -->
        <el-tab-pane
          :label="item.configName"
          :name="item.id"
          v-for="item in listPrasm"
          :key="item.id"
        >
          <span
            slot="label"
            style="font-size: 16px; display: flex; align-items: center"
            class="xzxhx"
          >
            <div
              style="margin-top: -2px; display: flex; align-items: center"
              :class="activeName == item.id ? 'xhxShow' : ''"
            >
              <img
                :src="activeName == item.id ? item.img : item.img2"
                style="width: 16px; height: 16px; margin-right: 5px"
              />
              <span :class="activeName == item.id ? 'textBox2' : 'textBox'">
                {{ item.configName }}</span
              >
              <!-- 选中下划线 -->
            </div>
          </span>
        </el-tab-pane>
        <!-- 原始数据搜索 -->
        <el-form
          inline
          label-width="auto"
          label-position="left"
          v-show="tebleParam.name == 3"
        >
          <el-form-item :label="mashezhi[5].name">
            <el-date-picker
              v-model="summaryformData.field102"
              type="daterange"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              value-format="yyyy-MM-dd"
              style="width: 200px"
           
            />
          </el-form-item>
          <el-form-item
            :label="mashezhi[4].name"
            style="margin-right: 40px; margin-left: 40px"
          >
            <el-input
              maxlength="20"
              clearable
              v-model="summaryformData.field103"
              :placeholder="mashezhi[4].name"
              style="width: 200px"
            />
          </el-form-item>
          <el-form-item :label="mashezhi[1].name" style="margin-right: 40px">
            <el-input
              maxlength="100"
              clearable
              v-model="summaryformData.field104"
              :placeholder="mashezhi[1].name"
              style="width: 200px"
            />
          </el-form-item>
          <el-form-item :label="mashezhi[2].name" style="margin-right: 40px">
            <el-input
              maxlength="20"
              clearable
              v-model="summaryformData.field106"
              :placeholder="mashezhi[2].name"
              style="width: 200px"
            />
          </el-form-item>
          <el-form-item :label="mashezhi[3].name" style="margin-right: 30px">
            <el-select
              clearable
              v-model="summaryformData.field105"
              :placeholder="mashezhi[3].name"
              style="width: 200px"
              filterable
            >
              <el-option
                v-for="item in optionss"
                :key="item.userId"
                :label="item.nickName"
                :value="item.userId"
              >
              </el-option>
            </el-select>
          </el-form-item>

          <div style="display: flex; justify-content: center">
            <el-button
              icon="el-icon-refresh"
              style="background: #eeeeee; color: #6396f4; font-weight: bold"
              @click="desensitizationReset('summaryformData', 1)"
              >重置
            </el-button>
            <el-button
              type="primary"
              icon="el-icon-search"
              @click="switchButton(1)"
              >搜索</el-button
            >
            <!-- <el-button
              type="primary"
              icon="el-icon-search"
              @click="CodeSetting(1)"
              >搜索</el-button
            > -->
          </div>
        </el-form>
        <!-- 码设置搜索 -->
        <el-form
          inline
          label-width="auto"
          v-show="tebleParam.name == 2 || tebleParam.name == 9"
          label-position="left"
        >
          <el-form-item :label="mashezhi[0].name">
            <el-date-picker
              v-model="SettingParam.valueTime"
              type="datetimerange"
          
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              align="right"
              style="width: 200px; margin-right: 30px"
              :default-time="['00:00:00', '23:59:59']"
              value-format="yyyy-MM-dd HH:mm:ss"
            >
            </el-date-picker>

            <!-- <el-date-picker
              v-model="SettingParam.valueTime"
              type="daterange"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              style="width: 200px"
              value-format="yyyy-MM-dd"
              :picker-options="pickerOptions0"
            /> -->
          </el-form-item>

          <!-- <el-form-item label="系统ID" style="margin-right: 40px;margin-left: 40px" label-width="66px">
              <el-input maxlength="20" clearable v-model="SettingParam.id" placeholder="请输入系统ID" style="width: 200px"/>
            </el-form-item> -->
          <el-form-item :label="mashezhi[1].name" style="margin-right: 40px">
            <el-input
              maxlength="100"
              clearable
              v-model="SettingParam.maBiaoShi"
              :placeholder="mashezhi[1].name"
              style="width: 200px"
            />
          </el-form-item>
          <el-form-item :label="mashezhi[2].name" style="margin-right: 40px">
            <el-input
              maxlength="20"
              clearable
              v-model="SettingParam.maName"
              :placeholder="mashezhi[2].name"
              style="width: 200px"
            />
          </el-form-item>
          <el-form-item label="状态" style="margin-right: 30px">
            <el-select
              clearable
              v-model="SettingParam.state"
              placeholder="请选择状态"
              style="width: 200px"
              filterable
            >
              <el-option
                v-for="item in optionssState"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item :label="mashezhi[3].name" style="margin-right: 30px">
            <el-select
              clearable
              v-model="SettingParam.userId"
              :placeholder="mashezhi[3].name"
              style="width: 200px"
              filterable
            >
              <el-option
                v-for="item in optionss"
                :key="item.userId"
                :label="item.nickName"
                :value="item.userId"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <div style="display: flex; justify-content: center">
            <el-button
              icon="el-icon-refresh"
              style="background: #eeeeee; color: #6396f4; font-weight: bold"
              @click="desensitizationReset('teamformData', 4)"
              >重置
            </el-button>
            <el-button
              type="primary"
              icon="el-icon-search"
              @click="switchButton(1)"
              >搜索</el-button
            >
          </div>
        </el-form>
        <!-- 汇总数据和脱敏汇总搜索 -->
        <el-form
          inline
          label-width="auto"
          label-position="left"
          v-show="tebleParam.name == 11 || tebleParam.name == 4"
        >
          <!-- <el-form
          inline
          label-width="auto"
          label-position="left"
          v-show="
            tebleParam.name == '汇总数据' || tebleParam.label == '脱敏汇总'
          "
        > -->
          <el-form-item :label="mashezhi[5].name">
            <el-date-picker
              v-model="summaryformData.field102"
              type="daterange"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              value-format="yyyy-MM-dd"
              style="width: 200px"
            
            />
          </el-form-item>
          <el-form-item
            :label="mashezhi[4].name"
            style="margin-right: 40px; margin-left: 40px"
          >
            <el-input
              maxlength="20"
              clearable
              v-model="summaryformData.field103"
              :placeholder="mashezhi[4].name"
              style="width: 200px"
            />
          </el-form-item>
          <el-form-item :label="mashezhi[1].name" style="margin-right: 40px">
            <el-input
              maxlength="100"
              clearable
              v-model="summaryformData.field104"
              :placeholder="mashezhi[1].name"
              style="width: 200px"
            />
          </el-form-item>
          <el-form-item :label="mashezhi[2].name" style="margin-right: 40px">
            <el-input
              maxlength="20"
              clearable
              v-model="summaryformData.field106"
              :placeholder="mashezhi[2].name"
              style="width: 200px"
            />
          </el-form-item>
          <el-form-item :label="mashezhi[3].name" style="margin-right: 30px">
            <el-select
              clearable
              v-model="summaryformData.field105"
              :placeholder="mashezhi[3].name"
              style="width: 200px"
              filterable
            >
              <el-option
                v-for="item in optionss"
                :key="item.userId"
                :label="item.nickName"
                :value="item.userId"
              >
              </el-option>
            </el-select>
          </el-form-item>

          <div style="display: flex; justify-content: center">
            <el-button
              icon="el-icon-refresh"
              style="background: #eeeeee; color: #6396f4; font-weight: bold"
              @click="desensitizationReset('summaryformData', 2)"
              >重置
            </el-button>
            <el-button
              type="primary"
              icon="el-icon-search"
              @click="switchButton(1)"
              >搜索</el-button
            >
            <!-- <el-button
              type="primary"
              icon="el-icon-search"
              @click="CodeSetting(2)"
              >搜索</el-button
            > -->
          </div>
        </el-form>
        <!-- 会员汇总搜索 -->
        <el-form
          inline
          label-width="auto"
          label-position="left"
          v-show="tebleParam.name == 5 || tebleParam.name == 12"
        >
          <el-form-item :label="mashezhi[5].name">
            <el-date-picker
              v-model="memberformData.field102"
              type="daterange"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              value-format="yyyy-MM-dd"
              style="width: 200px"
         
            />
          </el-form-item>

          <el-form-item :label="mashezhi[3].name" style="margin-right: 30px">
            <el-select
              clearable
              v-model="memberformData.field103"
              :placeholder="mashezhi[3].name"
              style="width: 200px"
              filterable
            >
              <el-option
                v-for="item in optionss"
                :key="item.userId"
                :label="item.nickName"
                :value="item.userId"
              >
              </el-option>
            </el-select>
          </el-form-item>

          <span>
            <el-button
              icon="el-icon-refresh"
              style="background: #eeeeee; color: #6396f4; font-weight: bold"
              @click="desensitizationReset('memberformData', 2)"
              >重置
            </el-button>
            <el-button
              type="primary"
              icon="el-icon-search"
              @click="switchButton(1)"
              >搜索</el-button
            >
            <!-- <el-button
              type="primary"
              icon="el-icon-search"
              @click="switchButton()"
              >搜索</el-button
            > -->
          </span>
        </el-form>
        <!-- 团队汇总搜索 -->
        <el-form
          inline
          label-width="auto"
          label-position="left"
          v-show="tebleParam.name == 6 || tebleParam.name == 13"
        >
          <el-form-item :label="mashezhi[5].name">
            <el-date-picker
              v-model="teamformData.field102"
              type="daterange"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              style="width: 200px"
              value-format="yyyy-MM-dd"
          
            />
          </el-form-item>

          <el-form-item :label="mashezhi[3].name" style="margin-right: 30px">
            <el-select
              clearable
              v-model="teamformData.field103"
              :placeholder="mashezhi[3].name"
              style="width: 200px"
              filterable
            >
              <el-option
                v-for="item in optionss"
                :key="item.userId"
                :label="item.nickName"
                :value="item.userId"
              >
              </el-option>
            </el-select>
          </el-form-item>

          <span>
            <el-button
              icon="el-icon-refresh"
              style="background: #eeeeee; color: #6396f4; font-weight: bold"
              @click="desensitizationReset('teamformData', 3)"
              >重置
            </el-button>
            <el-button
              type="primary"
              icon="el-icon-search"
              @click="switchButton(1)"
              >搜索</el-button
            >
            <!-- <el-button
              type="primary"
              icon="el-icon-search"
              @click="switchButton()"
              >搜索</el-button
            > -->
          </span>
        </el-form>
        <div class="xhxBox"></div>

        <!-- 结果汇总的是否统计显示便签 -->
        <div
          class="LabelBox"
          v-show="
            tebleParam.name == 4 ||
            tebleParam.name == 11 ||
            tebleParam.name == 12 ||
            tebleParam.name == 5 ||
            tebleParam.name == 6 ||
            tebleParam.name == 13
          "
        >
          <div class="LabelMiniBox">
            <span
              v-for="tag in postData"
              :key="tag.name"
              class="LabelMiniBox_span"
            >
              {{ tag.name }}：
              <span style="color: #1890ff"> {{ tag.statistics }}，</span>
            </span>
          </div>
          <!-- <el-button
            style="background: #eeeeee; color: #6396f4; font-weight: bold;height:37px;"
            @click="handleAdd()"
          >
            <img
              src="@/assets/img/daochu.svg"
              style="
                width: 15px;
                height: 15px;
                margin-right: 5px;
                margin-bottom: -2px;
              "
            />导出
          </el-button> -->
        </div>
        <!-- <div class="xhxBox" v-show="postData.length > 0"></div> -->
        <!-- 码设置按钮 -->
        <div
          v-show="tebleParam.name == 2 || tebleParam.name == 9"
          style="display: flex; justify-content: space-between; margin: 10px 0"
        >
          <div>
            <!-- <el-button
              type="primary"
              @click="uploadDialogVisible = true"
              v-if="userName != '用户'"
              :disabled="buttonShow"
            >
              <img
                src="@/assets/img/shangchuan.png"
                style="
                  width: 15px;
                  height: 15px;
                  margin-right: 5px;
                  margin-bottom: -2px;
                "
              />
              上传码
            </el-button> -->
            <el-button
              type="primary"
              @click="transfersBotton"
              :disabled="buttonShow"
            >
              <img
                src="@/assets/img/piliang.png"
                style="
                  width: 15px;
                  height: 15px;
                  margin-right: 5px;
                  margin-bottom: -2px;
                "
              />
              批量划拔</el-button
            >
            <el-button
              type="primary"
              v-if="userName != '用户'"
              @click="recoveryVisible = true"
              :disabled="buttonShow"
            >
              <img
                src="@/assets/img/huishou.png"
                style="
                  width: 15px;
                  height: 15px;
                  margin-right: 5px;
                  margin-bottom: -2px;
                "
              />
              批量回收</el-button
            >
            <el-button
              type="primary"
              v-if="addBottonShow != 0"
              @click="addDialogVisible = true"
              :disabled="buttonShow"
            >
              <img
                src="@/assets/img/xinzeng.png"
                style="
                  width: 15px;
                  height: 15px;
                  margin-right: 5px;
                  margin-bottom: -2px;
                "
              />
              新增</el-button
            >
            <el-button
              type="primary"
              v-if="addBottonShow != 0"
              @click="fastaddDialogVisible = true"
              :disabled="buttonShow"
            >
              <img
                src="@/assets/img/xinzeng.png"
                style="
                  width: 15px;
                  height: 15px;
                  margin-right: 5px;
                  margin-bottom: -2px;
                "
              />
              快速新增</el-button
            >
          </div>
          <div>
            <el-button
              style="
                background: #eeeeee;
                color: #6396f4;
                font-weight: bold;
                height: 37px;
              "
              @click="mszButton"
            >
              <img
                src="@/assets/img/daochu.svg"
                style="
                  width: 15px;
                  height: 15px;
                  margin-right: 5px;
                  margin-bottom: -2px;
                "
              />导出
            </el-button>
          </div>
        </div>
        <!-- 汇总数据和脱敏汇总按钮 -->
        <div
          v-show="tebleParam.name == 4 || tebleParam.name == 11"
          style="display: flex; justify-content: space-between; margin: 5px 0"
        >
          <div></div>
          <el-button
            style="
              background: #eeeeee;
              color: #6396f4;
              font-weight: bold;
              margin-top: -45px;
              height: 37px;
            "
            @click="handleAdd(2)"
          >
            <img
              src="@/assets/img/daochu.svg"
              style="
                width: 15px;
                height: 15px;
                margin-right: 5px;
                margin-bottom: -2px;
              "
            />导出
          </el-button>
        </div>
        <!-- 会员汇总按钮 -->
        <div
          v-show="tebleParam.name == 5 || tebleParam.name == 12"
          style="display: flex; justify-content: space-between; margin: 5px 0"
        >
          <div></div>
          <el-button
            style="
              background: #eeeeee;
              color: #6396f4;
              font-weight: bold;
              margin-top: -45px;
              height: 37px;
            "
            @click="handleAdd(3)"
          >
            <img
              src="@/assets/img/daochu.svg"
              style="
                width: 15px;
                height: 15px;
                margin-right: 5px;
                margin-bottom: -2px;
              "
            />导出
          </el-button>
        </div>
        <!-- 原始数据按钮 -->
        <div
          v-show="tebleParam.name == 3"
          style="display: flex; justify-content: space-between; margin: 5px 0"
        >
          <div></div>
          <el-button
            style="background: #eeeeee; color: #6396f4; font-weight: bold"
            @click="handleAdd(1)"
          >
            <img
              src="@/assets/img/daochu.svg"
              style="
                width: 15px;
                height: 15px;
                margin-right: 5px;
                margin-bottom: -2px;
              "
            />导出
          </el-button>
        </div>
        <!-- 团队汇总按钮 -->
        <div
          v-show="tebleParam.name == 6 || tebleParam.name == 13"
          style="display: flex; justify-content: space-between; margin: 5px 0"
        >
          <div></div>
          <el-button
            style="
              background: #eeeeee;
              color: #6396f4;
              font-weight: bold;
              margin-top: -45px;
              height: 37px;
            "
            @click="handleAdd(4)"
          >
            <img
              src="@/assets/img/daochu.svg"
              style="
                width: 15px;
                height: 15px;
                margin-right: 5px;
                margin-bottom: -2px;
              "
            />导出
          </el-button>
        </div>

        <!--  -->
        <el-table
          :data="roleList"
          :header-cell-style="{
            background: '#FAFAFA',
            color: 'black',
            'font-size': 15 + 'px',
            'text-align': 'center',
          }"
          height="560"
        >
          <el-table-column
            @cell-mouse-enter="handleMouseEnter"
            :prop="item2.columnKey"
            :label="item2.columnName"
            align="center"
            v-for="item2 in tableData"
            :key="item2.id"
            :show-overflow-tooltip="true"
          >
            <template slot-scope="scope">
              <span v-if="item2.data == 1" @click="copyButton">
                <el-popover trigger="hover" placement="top">
                  <vue-qr
                    :text="scope.row[item2.columnKey]"
                    :margin="1"
                    :size="300"
                    style="height: 250px"
                  ></vue-qr>
                  <div slot="reference" class="name-wrapper">
                    <el-tag size="medium">{{
                      scope.row[item2.columnKey]
                    }}</el-tag>
                  </div>
                </el-popover>
              </span>

              <span
                v-else-if="item2.columnKey == 'id_name' && activeName == '2'"
              >
                <span>{{ scope.row[item2.columnKey] }}</span>
                <span
                  ><i
                    @click="mashezhieditBotton(scope.row)"
                    class="el-icon-edit"
                    style="margin-left: 5px; cursor: pointer; color: #538aff"
                  ></i
                ></span>
              </span>

              <span v-else-if="item2.columnKey == 'user_name'">
                <el-button
                  type="text"
                  @click="CheckSuperior(scope.row)"
                  style="
                    height: auto;
                    margin: 0px;
                    padding: 0px;
                    text-decoration: underline;
                  "
                  >{{ scope.row[item2.columnKey] }}</el-button
                >
              </span>

              <span v-else-if="scope.row[item2.columnKey] == '0'">{{
                scope.row[item2.columnKey]
              }}</span>

              <!-- <span v-else>{{ scope.row[item2.columnKey] || "-" }}</span> -->
              <span
                v-else
                class="tag-read"
                style="cursor: pointer"
                :data-clipboard-text="scope.row[item2.columnKey]"
                @click="copyButton"
                >{{ scope.row[item2.columnKey] || "-" }}</span
              >
            </template>
          </el-table-column>
          <!-- 会员汇总操作 -->
          <!-- <el-table-column
            label="操作"
            align="center"
            prop="amount"
            v-if="
              (userName != '用户' && !buttonShow && tebleParam.name == 5) ||
              tebleParam.name == 12
            "
          >
            <template slot-scope="scope">
              <el-button round type="text" @click="otherExport(scope.row)"
                >查看上级</el-button
              >
            </template>
          </el-table-column> -->
          <!-- 码设置操作 -->
          <el-table-column
            prop="capItemCodePoolBelongingOne"
            label="操作"
            align="center"
            v-if="(!buttonShow && tebleParam.name == 2) || tebleParam.name == 9"
            width="170"
          >
            <template slot-scope="scope">
              <!-- <el-button type="text" @click="mashezhieditBotton(scope.row)"
                >编辑</el-button
              > -->
              <el-button type="text" @click="transferBotton(scope.row)"
                >划拨</el-button
              >
              <el-button
                type="text"
                v-if="userName != '用户'"
                @click="delBotton(scope.row)"
                v-hasPermi="['selfcom:role:edit']"
                >删除</el-button
              >
              <el-button
                type="text"
                v-if="userName != '用户'"
                @click="editBotton(scope.row)"
                v-hasPermi="['selfcom:role:edit']"
                >回收</el-button
              >
            </template>
          </el-table-column>
        </el-table>
        <!-- 分页插件 -->
        <pagination
          :total="total"
          style="margin: 40px 0px"
          :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize"
          @pagination="switchButton"
        />
      </el-tabs>
    </div>
    <!-- </el-card> -->
    <!-- 查看上级 -->
    <ViewSuperior ref="superior" :IdData="IdData" />
    <!-- 公告弹窗 -->
    <Dialog
      ref="mychild"
      @AddAnnouncement="AddAnnouncement"
      :proId="proId"
      :configTypeId="configTypeId"
      :uelLocation="uelLocation"
    />
  </div>
</template>

<script>
import { getInfo, getIdentityAndTopId } from "@/api/login.js";
import ViewSuperior from "@/views/components/ViewSuperior.vue";
import Clipboard from "clipboard";
import VueQr from "vue-qr";
import {
  geteditAPI,
  selectByCodeCondition,
  userNewCode,
  tenantByRecovery,
  userTransfer,
  deleteByIds,
  downLoadFormwork,
  uploadCode,
  transferFormwork,
  uploadtransfer,
  desensitizationAPI,
  dateConditionQueryList,
  selectByProId,
  moreAPI,
  geteditindex,
  exportButton,
  mszexportButton,
  updateByIdName,
  selectSumByKey,
} from "@/api/projectManagement/index.js";
import {
  selectUserGroupRelaList,
  selectBySuperior,
  selectByHierarchy,
  allUsers,
} from "@/api/base/index.js";
import Dialog from "@/views/components/Dialog.vue";
export default {
  components: { VueQr, Dialog, ViewSuperior },
  data() {
    return {
      //时间选择器的快捷选择
      pickerOptions: {
        shortcuts: [
          {
            text: "最近一周",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近三个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
              picker.$emit("pick", [start, end]);
            },
          },
        ],
      },
      //查看上级组件参数
      IdData: "",
      configTypeId: "",
      uelLocation: "",
      proId: "",
      // 结果汇总是否统计标签参数
      postData: [
        //  {name:"1"}
      ],
      //码设置编辑弹窗
      editVisible: false,
      //码设置编辑参数
      editrData: {
        field101: "",
        id: "",
      },
      //所有搜索名称
      // mashezhi[3].name    用户昵称
      // mashezhi[0].name    时间
      // mashezhi[4].name  系统ID
      // mashezhi[1].name    识别号
      // mashezhi[2].name    码名称
      mashezhi: [
        { name: "" },
        { name: "" },
        { name: "" },
        { name: "" },
        { name: "" },
        { name: "" },
      ],

      //如果为码池分权模式那么就显示快速新增和新增按钮
      addBottonShow: 0,
      listPrasm: [],

      //判断表头切换页面是否显示
      divShowData: {},
      //如果表头获取为空，那么所有操作和按钮都不显示或禁用
      buttonShow: false,
      //查看上级数据参数
      CheckSuperiorData: [
        // {userName:"111",phoneNumber:"15555555555"},
      ],
      // 查看上级数据显示的最后一位
      CheckSuperiorNumber: "",
      //查看上级弹窗
      SuperiorShow: false,
      //切换页面的参数
      switchpage: "0",
      aaa: true,
      // 向上向下单选框
      linkOptions: [
        {
          label: "向上划拨",
          value: 4,
        },
        {
          label: "向下划拨",
          value: 1,
        },
      ],
      //批量划拨上传
      field102fileList: [],
      //批量回收

      recoveryVisible: false,
      // 批量回收上传
      field105fileList: [],
      //批量回收参数
      recoveryData: {
        field101: 0,
        field102: undefined,
      },
      //批量回收必填
      recoveryrules: {
        field101: [
          {
            required: true,
            message: "请输入识别名称",
            trigger: "blur",
          },
        ],
        field102: [
          {
            required: true,
            message: "请选择划拨用户",
            trigger: "change",
          },
        ],
      },
      //码设置搜索的状态
      optionssState: [
        { value: undefined, label: "全部" },
        { value: 1, label: "使用" },
        { value: 0, label: "未使用" },
      ],
      // 下拉框
      optionss: [{ value: 1, label: "1" }],
      //批量划拨弹窗
      drawingVisible: false,
      //识别码合并数据
      pickerOptions0: {
        disabledDate(time) {
          return time.getTime() > Date.now() - 8.64e6;
        },
      },
      //全选取消全选
      checkBox: 0,
      //上传码弹窗
      uploadDialogVisible: false,
      uploadData: {
        field101: null,
      },
      uploadrules: {},
      field101Action: "https://jsonplaceholder.typicode.com/posts/",
      field101fileList: [],
      //快速新增弹窗参数
      fastaddDialogVisible: false,
      fastaddrData: {
        field101: "",
      },
      fastaddrDatarules: {
        field101: [
          {
            required: true,
            message: "请输入新增数量",
            trigger: "change",
          },
          {
            pattern: /^\d+$/,
            message: "格式错误",
            trigger: "change",
          },
        ],
      },
      //新增弹窗参数
      addDialogVisible: false,
      addrData: {
        field101: "",
      },
      addrDatarules: {
        field101: [
          {
            required: true,
            message: "请输入广告位名称",
            trigger: "change",
          },
        ],
      },
      editrDatarules: {
        field101: [
          {
            required: true,
            message: "不可为空",
            trigger: "change",
          },
        ],
      },
      //分页
      total: 0,
      queryParams: {
        pageSize: 10,
        pageNum: 1,
      },
      //划拨弹窗参数
      transferDialogVisible: false,

      transferData: {
        field101: 1,
        field102: undefined,
      },
      transferrules: {
        field101: [
          {
            required: true,
            message: "请输入识别名称",
            trigger: "blur",
          },
        ],
        field102: [
          {
            required: true,
            message: "请选择划拨用户",
            trigger: "change",
          },
        ],
      },
      transferOptions: [
        {
          nickName: "选项一",
          userId: 1,
        },
      ],
      // 当前用户ID
      userId: 0,
      // 码设置搜索
      SettingParam: {
        valueTime: [],
        cTime: "",
        eTime: "",
        id: "", //系统ID
        maBiaoShi: "", //广告位名称
        maLianJie: "", //广告位链接
        maName: "",
        proId: "",
        pageNum: 1,
        pageSize: 10,
        state: undefined, //已使用1,0未分配
        wbList: [], //文本集合
        userId:undefined, //归属人
      },
      // 表格
      tableData: [
        // { code: "2", remark: false }
      ],
      roleList: [{ link_5d: "2", id_name: 4 }],
      //租户还是用户
      userName: "",
      //
      //码汇总数据上传弹窗
      uploadButtonSummary: false,
      //码汇总数据上传弹窗参数
      Summary: {
        field104: null,
        field102: undefined,
        field103: null,
      },
      Summaryrules: {
        field104: [
          {
            required: true,
            message: "请选择日期选择",
            trigger: "change",
          },
        ],
        field102: [
          {
            required: true,
            message: "请选择下拉选择",
            trigger: "change",
          },
        ],
      },
      Summaryptions: [
        {
          label: "选项一",
          value: 1,
        },
        {
          label: "选项二",
          value: 2,
        },
      ],
      //脱敏数据转汇总弹窗
      TotalTransferShow: false,
      TotalTransferrules: {
        field104: [
          {
            required: true,
            message: "请选择日期选择",
            trigger: "change",
          },
        ],
        field102: [
          {
            required: true,
            message: "请选择下拉选择",
            trigger: "change",
          },
        ],
      },
      TotalTransfer: {
        field101: null,
        field102: undefined,
        field103: null,
        field104: null,
        field105: null,
        field106: null,
        field107: null,
      },

      formData: {
        field102: [],
        field103: "",
        field104: "",
        field105: "",
        field106: "",
      },
      //会员汇总数据搜索
      memberformData: {
        field102: [],
        field103: "1",
      },
      //团队汇总数据搜索
      teamformData: {
        field102: [],
        field103: "1",
      },
      //码汇总数据搜索
      summaryformData: {
        field102: [],
        field103: "",
        field104: "",
        field105: "1",
        field106: "",
      },

      rules: {
        field102: [],
        field103: [],
        field104: [],
        field105: [],
      },
      pickerOptions0: {
        disabledDate(time) {
          return time.getTime() > Date.now() - 8.64e6;
        },
      },
      pdfUrl: "",
      // 切换佣金收入和分润收入
      // activeName: "0",
      activeName: "2",
      // ..提现弹窗
      centerDialogVisible: false,
      // ..提现窗口3个数据
      ruleForm: {
        money: "",
        region: "",
        date2: "",
        monetUser: "",
      },
      // ..卡片总数据
      CardData: {},
      rules: {
        money: [{ required: true, message: "请输入提现金额", trigger: "blur" }],
        region: [
          { required: true, message: "请选择提现类型", trigger: "change" },
        ],
        monetUser: [
          { required: true, message: "请选择提现账号", trigger: "blur" },
        ],
      },
      // ..提现账号下拉框数据
      monetUser: [],
      // 用户ID
      userId: 0,
      // 类型搜索
      field101Options: [],
      //其它搜索类型
      otherOptions: [
        {
          proName: "平台减少",
          proId: 4,
        },
        {
          proName: "平台增加",
          proId: 3,
        },
      ],
      // 遮罩层
      loading: true,
      // 显示搜索条件
      showSearch: true,
      // 分页总条数
      total: 0,
      // 收入表格数据
      noticeList: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        // 搜索类型
        amountType: "",
        // 时间
        dateRange: "",
        //出资方
        fromUserName: "",
        field106: "",
        field104: "",
      },
      //上传文件的参数
      fileList: [],
      //临时变量
      temporary: null,
      //批量划拨保存的数组
      variable: [],

      tebleParam: {
        name: "",
        label: "",
      },
    };
  },
  async mounted() {
    // 获取userID
    this.userId = sessionStorage.getItem("userID") - 0;
    //  //获取是租户还是用户还是平台
    const { data } = await getIdentityAndTopId();
    //console.log(data, "用户信息平台还是租户");

    this.userName = data.identity;

    // this.SettingParam.valueTime[0] =
    //   this.moment().format("YYYY") +
    //   "-" +
    //   this.moment().format("MM") +
    //   "-" +
    //   "01";
    // this.SettingParam.valueTime[1] = this.moment().format("YYYY-MM-DD");
    // this.summaryformData.field102[0] =
    //   this.moment().format("YYYY") +
    //   "-" +
    //   this.moment().format("MM") +
    //   "-" +
    //   "01"+""+"00:00:00";
    // this.summaryformData.field102[1] = this.moment().format("YYYY-MM-DD")+""+"23:59:59";

    // this.memberformData.field102[0] =
    //   this.moment().format("YYYY") +
    //   "-" +
    //   this.moment().format("MM") +
    //   "-" +
    //   "01";
    // this.memberformData.field102[1] = this.moment().format("YYYY-MM-DD");
    // this.teamformData.field102[0] =
    //   this.moment().format("YYYY") +
    //   "-" +
    //   this.moment().format("MM") +
    //   "-" +
    //   "01";
    // this.teamformData.field102[1] = this.moment().format("YYYY-MM-DD");

    this.getParam();
    //如果为码池分权模式那么就显示快速新增和新增按钮
    this.ShowAddButton();
  
  },
  methods: {
    // 点击复制案件
    copyButton(row) {
      var clipboard = new Clipboard(".tag-read");
      clipboard.on("success", (e) => {
        this.$message({
          message: "复制成功!",
          type: "success",
        });
        // success("复制成功");//这里你如果引入了elementui的提示就可以用，没有就注释即可
        // 释放内存
        clipboard.destroy();
      });
      clipboard.on("error", (e) => {
        // 不支持复制
        //console.log("该浏览器不支持自动复制");
        // 释放内存
        clipboard.destroy();
      });
    },
    // 点击查看上级按钮
    async CheckSuperior(row) {
      //  //console.log(row,'2222')
      this.IdData = row.user_id - 0;
      this.$refs.superior.gitData();
    },
    //码设置编辑确定按钮
    editSubmitButton() {
      this.$refs["editrData"].validate(async (valid) => {
        if (valid) {
          let param = {
            proId: this.$route.query.proId - 0,
            id: this.editrData.id,
            idName: this.editrData.field101,
          };
          const data = await updateByIdName(param);
          if (data.code == 200) {
            this.$message({
              message: "编辑成功!",
              type: "success",
            });
            this.editVisible = false;
            this.editrData.field101 = "";
            this.switchButton(); //更新页面
          } else {
            this.$message.error("操作失败!");
          }
          //console.log(data, "回调");
        }
      });
    },
    mashezhieditBotton(row) {
      //console.log(row, "码设置编辑");
      this.editrData.id = row.id;
      this.editVisible = true;
    },
    // 其他导出
    async handleAdd(typeId) {
        let type = '0';
      //选择全部就传1,否则就传0
      if (
        this.summaryformData.field105 == "1" ||
        this.teamformData.field103 == "1" ||
        this.memberformData.field103 == "1" ||
        this.SettingParam.userId == "1"
      ) {
        // alert("1")
        type = '1';
      } else {
        type = '0';
      }
        // //console.log(this.activeName,'导出')
      // //console.log(this.listPrasm,'导出2');
      let dcName=[
      {configName:"表格"}
      ];
       dcName=this.listPrasm.filter(item=>item.id==this.activeName);
      if (!this.teamformData.field102) {
        this.teamformData.field102 = [];
      }
      if (!this.memberformData.field102) {
        this.memberformData.field102 = [];
      }
      if (!this.summaryformData.field102) {
        this.summaryformData.field102 = [];
      }
      if (!this.SettingParam.valueTime) {
        this.SettingParam.valueTime = [];
      }
      // //console.log(this.tableData[0].configTypeId,'66666');
      let param = {};
      //2022-2-21 世杰说用户状态下也能导出下级数据
      if (typeId == 2) {
        if (this.userName == "用户") {
          param = {
            type: typeId,
            proId: this.$route.query.proId - 0,
            cTime: this.summaryformData.field102[0] || undefined,
            eTime: this.summaryformData.field102[1] || undefined,
            uuid: this.summaryformData.field104 || undefined, //识别号
            // userId: this.userId, //用户昵称
             userId: this.summaryformData.field105 || this.userId, //用户昵称
            idName: this.summaryformData.field106 || undefined, //码名称
            id: this.formData.field103 || undefined, //系统ID
            flag: 1, //固定的值
            isAll: type,
            configTypeId: this.tableData[0].configTypeId,
          };
        } else {
          param = {
            type: typeId,
            proId: this.$route.query.proId - 0,
            cTime: this.summaryformData.field102[0] || undefined,
            eTime: this.summaryformData.field102[1] || undefined,
            uuid: this.summaryformData.field104 || undefined, //识别号
            userId: this.summaryformData.field105 || undefined, //用户昵称
            idName: this.summaryformData.field106 || undefined, //码名称
            id: this.formData.field103 || undefined, //系统ID
            flag: 1, //固定的值
            configTypeId: this.tableData[0].configTypeId,
          };
        }
      } else if (typeId == 1) {
        
        if (this.userName == "用户") {
          param = {
            type: typeId,
            proId: this.$route.query.proId - 0,
            cTime: this.summaryformData.field102[0] || undefined,
            eTime: this.summaryformData.field102[1] || undefined,
            uuid: this.summaryformData.field104 || undefined, //识别号
            // userId: this.userId, //用户昵称
             userId: this.summaryformData.field105 || this.userId, //用户昵称
            idName: this.summaryformData.field106 || undefined, //码名称
            id: this.summaryformData.field103 || undefined, //系统ID
            flag: 1, //固定的值
             isAll: type,
            configTypeId: this.tableData[0].configTypeId,
          };
        } else {
          param = {
            type: 1,
            proId: this.$route.query.proId - 0,
            cTime: this.summaryformData.field102[0] || undefined,
            eTime: this.summaryformData.field102[1] || undefined,
            uuid: this.summaryformData.field104 || undefined, //识别号
            userId: this.summaryformData.field105 || undefined, //用户昵称
            idName: this.summaryformData.field106 || undefined, //码名称
            id: this.summaryformData.field103 || undefined, //系统ID
            flag: 1, //固定的值
            configTypeId: this.tableData[0].configTypeId,
          };
        }
      } else if (typeId == 3) {
        
        if (this.userName == "用户") {
          param = {
            type: typeId,
            proId: this.$route.query.proId - 0,
            cTime: this.memberformData.field102[0] || undefined,
            eTime: this.memberformData.field102[1] || undefined,
            // userId: this.userId, //用户昵称
               userId: this.memberformData.field103 || this.userId, //用户昵称
            id: this.formData.field103 || undefined, //系统ID
            flag: 1, //固定的值
             isAll: type,
            configTypeId: this.tableData[0].configTypeId,
          };
        } else {
          param = {
            type: typeId,
            proId: this.$route.query.proId - 0,
            cTime: this.memberformData.field102[0] || undefined,
            eTime: this.memberformData.field102[1] || undefined,
            userId: this.memberformData.field103 || undefined, //用户昵称
            id: this.formData.field103 || undefined, //系统ID
            flag: 1, //固定的值
            configTypeId: this.tableData[0].configTypeId,
          };
        }
      } else if (typeId == 4) {
        
        if (this.userName == "用户") {
          param = {
            type: typeId,
            proId: this.$route.query.proId - 0,
            cTime: this.teamformData.field102[0] || undefined,
            eTime: this.teamformData.field102[1] || undefined,
            // userId: this.userId, //用户昵称
            userId: this.teamformData.field103 || this.userId, //用户昵称
            flag: 1,
             isAll: type,
            configTypeId: this.tableData[0].configTypeId,
          };
        } else {
          param = {
            type: typeId,
            proId: this.$route.query.proId - 0,
            cTime: this.teamformData.field102[0] || undefined,
            eTime: this.teamformData.field102[1] || undefined,
            userId: this.teamformData.field103 || undefined, //用户昵称
            flag: 1,
            configTypeId: this.tableData[0].configTypeId,
          };
        }
      }
      const res = await exportButton(param); //这是后端的接口
      var downloadUrl = window.URL.createObjectURL(res); //转换
      //添加一个a标签，利用a标签打开表格
      var anchor = document.createElement("a");
      anchor.href = downloadUrl;
      anchor.download = decodeURI(dcName[0].configName+".xlsx");
      anchor.click();
    },
    // 码设置导出
    async mszButton() {
      // //console.log(this.activeName,'导出')
      // //console.log(this.listPrasm,'导出2');
      let dcName=[
      {configName:"表格"}
      ];
       dcName=this.listPrasm.filter(item=>item.id==this.activeName);
      if (!this.teamformData.field102) {
        this.teamformData.field102 = [];
      }
      if (!this.memberformData.field102) {
        this.memberformData.field102 = [];
      }
      if (!this.summaryformData.field102) {
        this.summaryformData.field102 = [];
      }
      if (!this.SettingParam.valueTime) {
        this.SettingParam.valueTime = [];
      }
      let param = {};
      if (this.userName == "用户") {
        param = {
          proId: this.$route.query.proId - 0, //项目ID
          cTime: this.SettingParam.valueTime[0] || undefined, //开始时间
          eTime: this.SettingParam.valueTime[1] || undefined, //结束时间
          uuid: this.SettingParam.maBiaoShi || undefined, //识别号
          idName: this.SettingParam.maName || undefined, // 广告位名称
          state: this.SettingParam.state, //状态
          userId: this.userId, //归属人ID
          configTypeId: this.tableData[0].configTypeId,
          // this.SettingParam.id  //系统id
        };
      } else {
        param = {
          proId: this.$route.query.proId - 0, //项目ID
          cTime: this.SettingParam.valueTime[0] || undefined, //开始时间
          eTime: this.SettingParam.valueTime[1] || undefined, //结束时间
          uuid: this.SettingParam.maBiaoShi || undefined, //识别号
          idName: this.SettingParam.maName || undefined, // 广告位名称
          state: this.SettingParam.state, //状态
          userId: this.SettingParam.userId || undefined, //归属人ID
          configTypeId: this.tableData[0].configTypeId,
        };
      }
      const res = await mszexportButton(param);
      var downloadUrl = window.URL.createObjectURL(res); //转换
      //添加一个a标签，利用a标签打开表格
      var anchor = document.createElement("a");
      anchor.href = downloadUrl;
      anchor.download = decodeURI(dcName[0].configName+".xlsx");
      anchor.click();
    },

    // -----------------------------------------
    //如果为码池分权模式那么就显示快速新增和新增按钮
    async ShowAddButton() {
      const getdata = await geteditindex(this.$route.query.proId);
      if (getdata.code == 200) {
        this.addBottonShow = getdata.data.codeType;
        //项目模式 0划拨 1分权模式
      }
    },
    // 接收动态表头公用一个函数
    async common(proId, TypeId) {
      //获取表头
      const getedit = await geteditAPI({
        projectId: proId,
        configTypeId: TypeId,
      });
      // //console.log(getedit, "获取的元素222");
      if (getedit.code == 200) {
        if (getedit.data.length > 0) {
          getedit.data.forEach((item, index) => {
            // 先筛选出需要搜索的内容，让表头和搜索名一致
            // mashezhi[3].name    用户昵称
            // mashezhi[0].name    时间
            // mashezhi[4].name  系统ID
            // mashezhi[1].name    识别号
            // mashezhi[2].name    码名称
            // mashezhi[5].name    展业时间
            // if (item.columnKey == "upload_time") {
            if (item.columnKey == "c_time") {
              // //console.log(item,'时间')
              this.mashezhi[0].name = item.columnName;
              // if(this.userName!='用户'){
              //   this.mashezhi[0].name = item.columnName;
              // }else{
              //   getedit.data.splice(0,1);
              // }
            } else if (item.columnKey == "upload_time") {
              // 用户状态下，展业链接的上传时间不显示
              if (this.userName == "用户") {
                if (this.tebleParam.name == 2 || this.tebleParam.name == 9) {
                  getedit.data.splice(0, 1);
                }
              }
            } else if (item.columnKey == "uuid") {
              this.mashezhi[1].name = item.columnName;
            } else if (item.columnKey == "id_name") {
              this.mashezhi[2].name = item.columnName;
            } else if (item.columnKey == "user_name") {
              this.mashezhi[3].name = item.columnName;
            } else if (item.columnKey == "id") {
              this.mashezhi[4].name = item.columnName;
            } else if (item.columnKey == "business_time") {
              this.mashezhi[5].name = item.columnName;
            }
            //key包含link 那么就转换data
            if (item.columnKey.match("link")) {
              if (item.data != "") {
                const QRcode = JSON.parse(item.data);
                if (QRcode.QRcode != undefined) {
                  item.data = QRcode.QRcode;
                }
              }
            }
          });

          this.tableData = getedit.data;
          // //console.log(getedit.data, "7777777777");
        } else {
          // this.tableData = [{ columnName: "" }];
          this.buttonShow = true;
          // //console.log(this.tableData.length, "09089089089089");
        }
      }
    },
    //码设置列表 表格
    async CodeSetting(name, id) {
      this.postData = []; //初始化一下，不然会不停的添加
      // 码设置2-9 ==展业连接
      // 团队汇总6-13
      // 会员汇总5-12
      // 脱敏汇总4  ==数据汇总
      //原始数据 3  ==数据明细
      //汇总数据11
      //数据汇总4
      this.roleList = [];

      let type = '0';
      //选择全部就传1,否则就传0
      if (
        this.summaryformData.field105 == "1" ||
        this.teamformData.field103 == "1" ||
        this.memberformData.field103 == "1" ||
        this.SettingParam.userId == "1"
      ) {
        // alert("1")
        type = '1';
      } else {
        type = '0';
      }

      let param = {};
      let postParam = {
        proId: this.$route.query.proId - 0,
        configTypeId: id,
        flag: 1,
        isAll: type,
      };
      if (id == 4 || id == 11) {
        postParam = {
          proId: this.$route.query.proId - 0,
          configTypeId: id,
          flag: 1,
          isAll: type,
          cTime: this.summaryformData.field102[0],
          eTime: this.summaryformData.field102[1],
          uuid: this.summaryformData.field104 || undefined, //识别号
          userId: this.summaryformData.field105 || undefined, //用户昵称
          idName: this.summaryformData.field106 || undefined, //码名称
          id: this.formData.field103 || undefined, //系统ID
        };
        if (!this.summaryformData.field105 && this.userName == "用户") {
          param = {
            type: 2,
            isAll: type,
            proId: this.$route.query.proId - 0,
            pageNum: this.queryParams.pageNum,
            pageSize: this.queryParams.pageSize,
            cTime: this.summaryformData.field102[0] || undefined,
            eTime: this.summaryformData.field102[1] || undefined,
            uuid: this.summaryformData.field104 || undefined, //识别号
            userId: this.userId, //用户昵称
            idName: this.summaryformData.field106 || undefined, //码名称
            id: this.formData.field103 || undefined, //系统ID
            flag: 1, //固定的值
          };
        } else {
          param = {
            type: 2,
            isAll: type,
            proId: this.$route.query.proId - 0,
            pageNum: this.queryParams.pageNum,
            pageSize: this.queryParams.pageSize,
            cTime: this.summaryformData.field102[0] || undefined,
            eTime: this.summaryformData.field102[1] || undefined,
            uuid: this.summaryformData.field104 || undefined, //识别号
            userId: this.summaryformData.field105 || undefined, //用户昵称
            idName: this.summaryformData.field106 || undefined, //码名称
            id: this.formData.field103 || undefined, //系统ID
            flag: 1, //固定的值
          };
        }
        // //console.log(param, "码汇总数据表格444");
        const data2 = await dateConditionQueryList(param);
        // //console.log(data2, "码汇总数据表格");
        //循环出percentage的属性，然后转换为百分比
        data2.data.list.forEach((item) => {
          for (var population in item) {
            if (population.substr(0, population.length - 7) == "percentage") {
              // //console.log(item[population], "555");
              item[population] = item[population] * 100 + "%"; //成功率转换为%
            }
          }
        });
        if (data2.code == 200) {
          this.roleList = data2.data.list;
          this.total = data2.data.total;
        }
      } else if (id == 5 || id == 12) {
        postParam = {
          proId: this.$route.query.proId - 0,
          configTypeId: id,
          flag: 1,
          isAll: type,
          cTime: this.memberformData.field102[0],
          eTime: this.memberformData.field102[1],
          userId: this.memberformData.field103 || undefined, //用户昵称
          id: this.formData.field103 || undefined, //系统ID
        };
        if (!this.memberformData.field103 && this.userName == "用户") {
          param = {
            type: 3,
            isAll: type,
            proId: this.$route.query.proId - 0,
            pageNum: this.queryParams.pageNum,
            pageSize: this.queryParams.pageSize,
            cTime: this.memberformData.field102[0],
            eTime: this.memberformData.field102[1],
            userId: this.userId, //用户昵称
            id: this.formData.field103 || undefined, //系统ID
            flag: 1, //固定的值
          };
        } else {
          param = {
            type: 3,
            isAll: type,
            proId: this.$route.query.proId - 0,
            pageNum: this.queryParams.pageNum,
            pageSize: this.queryParams.pageSize,
            cTime: this.memberformData.field102[0],
            eTime: this.memberformData.field102[1],
            userId: this.memberformData.field103 || undefined, //用户昵称
            id: this.formData.field103 || undefined, //系统ID
            flag: 1, //固定的值
          };
        }

        const data3 = await dateConditionQueryList(param);
        // //console.log(data3, "会员汇总数据表格");
        //循环出percentage的属性，然后转换为百分比
        data3.data.list.forEach((item) => {
          for (var population in item) {
            if (population.substr(0, population.length - 7) == "percentage") {
              // //console.log(item[population], "555");
              item[population] = item[population] * 100 + "%"; //成功率转换为%
            }
          }
        });
        if (data3.code == 200) {
          this.roleList = data3.data.list;
          this.total = data3.data.total;
        }
      } else if (id == 6 || id == 13) {
        postParam = {
          proId: this.$route.query.proId - 0,
          configTypeId: id,
          flag: 1,
          isAll: 0,
          cTime: this.teamformData.field102[0],
          eTime: this.teamformData.field102[1],
          userId: this.teamformData.field103 || this.userId, //用户昵称   //团队汇总的话，结果汇总统计便签需要添加用户id
        };
       
        if (!this.teamformData.field103 && this.userName == "用户") {
          param = {
            type: 4,
            isAll: 0,
            proId: this.$route.query.proId - 0,
            pageNum: this.queryParams.pageNum,
            pageSize: this.queryParams.pageSize,
            cTime: this.teamformData.field102[0],
            eTime: this.teamformData.field102[1],
            userId: this.userId, //用户昵称
            flag: 1,
          };
        } else {
          param = {
            type: 4,
            isAll: 0,
            proId: this.$route.query.proId - 0,
            pageNum: this.queryParams.pageNum,
            pageSize: this.queryParams.pageSize,
            cTime: this.teamformData.field102[0],
            eTime: this.teamformData.field102[1],
            userId: this.teamformData.field103 || undefined, //用户昵称
            // userId: this.userId, //用户昵称
            flag: 1,
          };
        }

        // //console.log(param, "团队汇总数据表格后端传参");
        const data4 = await dateConditionQueryList(param);
        // //console.log(data4, "团队汇总数据表格");
        //循环出percentage的属性，然后转换为百分比
        data4.data.list.forEach((item) => {
          for (var population in item) {
            if (population.substr(0, population.length - 7) == "percentage") {
              // //console.log(item[population], "555");
              item[population] = item[population] * 100 + "%"; //成功率转换为%
            }
          }
        });
        if (data4.code == 200) {
          this.roleList = data4.data.list;
          this.total = data4.data.total;
        }
      } else if (id == 2 || id == 9) {
        if (!this.SettingParam.userId) {
          if (this.userName == "用户") {
            param = {
              isAll: type,
              pageNum: this.queryParams.pageNum,
              pageSize: this.queryParams.pageSize,
              proId: this.$route.query.proId, //项目ID
              uuid: this.SettingParam.maBiaoShi || undefined, //识别号
              idName: this.SettingParam.maName || undefined, // 广告位名称
              state: this.SettingParam.state, //状态
              userId: this.userId, //归属人ID
              // this.SettingParam.id  //系统id
            };
          } else {
            param = {
              isAll: type,
              pageNum: this.queryParams.pageNum,
              pageSize: this.queryParams.pageSize,
              proId: this.$route.query.proId, //项目ID
              cTime: this.SettingParam.valueTime[0], //开始时间
              eTime: this.SettingParam.valueTime[1], //结束时间
              uuid: this.SettingParam.maBiaoShi || undefined, //识别号
              idName: this.SettingParam.maName || undefined, // 广告位名称
              state: this.SettingParam.state, //状态
              userId: this.userId, //归属人ID
              // this.SettingParam.id  //系统id
            };
          }
        } else {
          if (this.userName == "用户") {

            param = {
              isAll: type,
              pageNum: this.queryParams.pageNum,
              pageSize: this.queryParams.pageSize,
              proId: this.$route.query.proId, //项目ID
              uuid: this.SettingParam.maBiaoShi || undefined, //识别号
              idName: this.SettingParam.maName || undefined, // 广告位名称
              state: this.SettingParam.state, //状态
              userId: this.SettingParam.userId || undefined, //归属人ID
            };
          } else {
            param = {
              isAll: type,
              pageNum: this.queryParams.pageNum,
              pageSize: this.queryParams.pageSize,
              proId: this.$route.query.proId, //项目ID
              cTime: this.SettingParam.valueTime[0], //开始时间
              eTime: this.SettingParam.valueTime[1], //结束时间
              uuid: this.SettingParam.maBiaoShi || undefined, //识别号
              idName: this.SettingParam.maName || undefined, // 广告位名称
              state: this.SettingParam.state, //状态
              userId: this.SettingParam.userId || undefined, //归属人ID
            };
          }
        }
        // //console.log(param, "传输数据");
        const dataList = await selectByCodeCondition(param);

        // //console.log(dataList, "表格");

        //循环出percentage的属性，然后转换为百分比
        dataList.data.list.forEach((item) => {
          for (var population in item) {
            if (population.substr(0, population.length - 7) == "percentage") {
              // //console.log(item[population], "555");
              item[population] = item[population] * 100 + "%"; //成功率转换为%
            }
          }
        });
        //  //console.log(this.tableData,'表头')
        if (dataList.code == 200) {
          dataList.data.list.forEach((item) => {
            if (item.state == 1) {
              item.state = "使用";
            } else {
              item.state = "未使用";
            }
          });

          this.total = dataList.data.total;
          this.roleList = dataList.data.list;
        }
      } else {
        if (!this.summaryformData.field105 && this.userName == "用户") {
          param = {
            type: 1,
            isAll: type,
            proId: this.$route.query.proId - 0,
            pageNum: this.queryParams.pageNum,
            pageSize: this.queryParams.pageSize,
            cTime: this.summaryformData.field102[0],
            eTime: this.summaryformData.field102[1],
            uuid: this.summaryformData.field104 || undefined, //识别号
            userId: this.userId, //用户昵称
            idName: this.summaryformData.field106 || undefined, //码名称
            id: this.summaryformData.field103 || undefined, //系统ID
            flag: 1, //固定的值
          };
        } else {
          param = {
            type: 1,
            isAll: type,
            proId: this.$route.query.proId - 0,
            pageNum: this.queryParams.pageNum,
            pageSize: this.queryParams.pageSize,
            cTime: this.summaryformData.field102[0],
            eTime: this.summaryformData.field102[1],
            uuid: this.summaryformData.field104 || undefined, //识别号
            userId: this.summaryformData.field105 || undefined, //用户昵称
            idName: this.summaryformData.field106 || undefined, //码名称
            id: this.summaryformData.field103 || undefined, //系统ID
            flag: 1, //固定的值
          };
        }
        if (this.$route.query.judgeParam == "2") {
          param.type = 2;
        }
        this.roleList = []; //这里因为500后会被若依卡住，导致上个页面的数据也会显示在
        //当前页面，所以在请求数据前先赋值为空，有数据就覆盖，没数据就为空
        const data = await dateConditionQueryList(param);
        // //console.log(data, "脱敏数据表格");
        //循环出percentage的属性，然后转换为百分比
        data.data.list.forEach((item) => {
          for (var population in item) {
            if (population.substr(0, population.length - 7) == "percentage") {
              // //console.log(item[population], "555");
              item[population] = item[population] * 100 + "%"; //成功率转换为%
            }
          }
        });
        if (data.code == 200) {
          // //console.log(data, "data666666666");
          this.roleList = data.data.list;
          this.total = data.data.total;
        }
      }
      // 获取脱敏汇总的是否统计数据
      //0未发布1是发布，未发布就是上传数据页面，发布就是数据展示页面，可以理解为传死数据就行

      const statisticsData = await selectSumByKey(postParam);
      if (statisticsData.code == 200 && statisticsData.data) {
        for (let i in statisticsData.data) {
          let o = {};
          o.name = i;
          o.statistics = statisticsData.data[i];
          this.postData.push(o);
        }
      }

      this.loading = false;
    },
    //一进来就执行切换页面头
    async getParam() {
      this.loading = false;
      const more = await moreAPI({
        projectTypeId: this.$route.query.judgeParam - 0,
      });
      if (more.code == 200) {
        more.data.forEach((item, index) => {
          if (item.configKey == "authority") {
            more.data.splice(index, 1);
          }
        });
        // this.listPrasm = more.data;
        // //console.log(this.listPrasm, "切换页面表头");

        // 获取表头切换的权限设置是否显示表头切换
        //判断脱敏码设置等切换按钮是否显示
        if (this.userName == "用户") {
          const getdata = await selectByProId({
            userId: this.userId,
            proId: this.$route.query.proId,
          });
          // //console.log(getdata, "获取参数");
          if (getdata.code == 200) {
            this.divShowData = getdata.data.proAuth;
            // getdata.data.proAuth.codeState; //码显示
            // //console.log(this.divShowData, "表头页面");
            // getdata.data.proAuth.dataHState; //数据汇总
            // getdata.data.proAuth.dataTeamState; //数据团队
            // getdata.data.proAuth.dataTState; //数据脱敏
          } else {
            this.$message.error(getdata.msg);
          }
        } else {
          this.divShowData = {
            codeState: 0,
            dataHState: 0,
            dataTState: 0,
            dataTeamState: 0,
          };
        }

        more.data.forEach((item) => {
          if (item.configKey == "code") {
            //展业链接
            item.qxszShow = this.divShowData.codeState;
            item.img = require("@/assets/img/mashezhi.png");
            item.img2 = require("@/assets/img/mashezhi2.png");
          } else if (item.configKey == "summary") {
            item.qxszShow = this.divShowData.dataHState;
            item.img = require("@/assets/img/huizongshuju.png");
            item.img2 = require("@/assets/img/huizongshuju2.png");
          } else if (item.configKey == "vipSummary") {
            item.qxszShow = 0;
            item.img = require("@/assets/img/huiyuanhuizong.png");
            item.img2 = require("@/assets/img/huiyuanhuizong2.png");
          } else if (item.configKey == "teamSummary") {
            //团队权限设置是否显示
            item.qxszShow = this.divShowData.dataTeamState;
            item.img = require("@/assets/img/tuanduihuizong.png");
            item.img2 = require("@/assets/img/tuanduihuizong2.png");
          } else {
            item.qxszShow = this.divShowData.dataTState;

            item.img = require("@/assets/img/yuanshi.png");
            item.img2 = require("@/assets/img/yuanshi2.png");
          }
        });
        //在权限设置里如果选择否，那么在这里就不显示切换表头1不显示 0显示
        this.listPrasm = more.data.filter((item) => item.qxszShow == 0);

        this.handleClick1({
          name: this.listPrasm[0].id,
          label: this.listPrasm[0].configName,
        });
      }
    },
    //更新页面函数
    switchButton(row) {
      this.handleClick1({
        name: this.tebleParam.name,
        label: this.tebleParam.label,
      });
        if(row){
         this.$message({
          message: '搜索中...',
          type: 'success'
        });
      }
    },
    //切换按钮
    handleClick(tab) {
      // //console.log(tab.index, "7788");
      this.queryParams.pageSize = 10;
      this.queryParams.pageNum = 1;
      //码汇总数据搜索
      this.summaryformData = {
        field102: [],
        field103: "",
        field104: "",
        field105: "",
        field106: "",
      };
      // 码设置搜索
      this.SettingParam = {
        valueTime: [],
        cTime: "",
        eTime: "",
        id: "", //系统ID
        maBiaoShi: "", //广告位名称
        maLianJie: "", //广告位链接
        maName: "",
        proId: "",
        pageNum: 1,
        pageSize: 10,
        state: undefined, //已使用1,0未分配
        wbList: [], //文本集合
        userId: "", //归属人
      };
      this.formData = {
        field102: [],
        field103: "",
        field104: "",
        field105: "",
        field106: "",
      };
      //会员汇总数据搜索
      this.memberformData = {
        field102: [],
        field103: "",
      };
      //团队汇总数据搜索
      this.teamformData = {
        field102: [],
        field103: "",
      };
      this.TotalTransfer = {
        field101: null,
        field102: undefined,
        field103: null,
        field104: null,
        field105: null,
        field106: null,
        field107: null,
      };
      //   this.summaryformData.field102[0] =
      //   this.moment().format("YYYY") +
      //   "-" +
      //   this.moment().format("MM") +
      //   "-" +
      //   "01"+""+"00:00:00";
      // this.summaryformData.field102[1] = this.moment().format("YYYY-MM-DD")+""+"23:59:59";
      //   this.summaryformData.field102[0] =
      //     this.moment().format("YYYY") +
      //     "-" +
      //     this.moment().format("MM") +
      //     "-" +
      //     "01";
      //   this.summaryformData.field102[1] = this.moment().format("YYYY-MM-DD");

      //   this.memberformData.field102[0] =
      //     this.moment().format("YYYY") +
      //     "-" +
      //     this.moment().format("MM") +
      //     "-" +
      //     "01";
      //   this.memberformData.field102[1] = this.moment().format("YYYY-MM-DD");
      //   this.teamformData.field102[0] =
      //     this.moment().format("YYYY") +
      //     "-" +
      //     this.moment().format("MM") +
      //     "-" +
      //     "01";
      //   this.teamformData.field102[1] = this.moment().format("YYYY-MM-DD");
      this.handleClick1(tab);
    },
    //切换按钮
    async handleClick1(tab, event) {
      this.optionss = [];
      if (!this.teamformData.field102) {
        this.teamformData.field102 = [];
      }
      if (!this.memberformData.field102) {
        this.memberformData.field102 = [];
      }
      if (!this.summaryformData.field102) {
        this.summaryformData.field102 = [];
      }
      if (!this.SettingParam.valueTime) {
        this.SettingParam.valueTime = [];
      }

      // //console.log(tab.name, "切换按钮");
      // //console.log(tab, "切换按钮2");
      if (this.tebleParam.name != tab.name) {
        this.queryParams = {
          pageSize: 10,
          pageNum: 1,
        };
        this.total = 0;
      }
      this.tebleParam.name = tab.name;
      this.tebleParam.label = tab.label;
      // this.switchpage = tab.index;

   
     

      if (this.userName == "用户") {
        this.AddAnnouncement(tab.name);
        // 获取归属人和用户昵称的下拉框
        const Owner = await selectUserGroupRelaList();
        // //console.log(Owner, "归属人列表");
        if (Owner.code == 200) {
          this.optionss = Owner.data.groupRelaList;
        } else {
          this.$message.error(Owner.msg);
        }
        if (this.tebleParam.name == 6 || this.tebleParam.name == 13) {
          this.optionss.splice(0, 0, {
            nickName: "自己",
            userId: this.userId - 0,
          });
        } else {
          this.optionss.splice(0, 0, { nickName: "全部", userId: "1" });
          //然后默认选中全部
             this.summaryformData.field105 = "1";
        this.teamformData.field103 = "1";
        this.memberformData.field103 = "1";
        // this.SettingParam.userId = "1";
        // this.switchButton(1);
        // this.getParam()
        }
      } else {
        // 获取归属人和用户昵称的下拉框
        const Owner2 = await allUsers();
        // //console.log(Owner2, "租户归属人列表");
        if (Owner2.code == 200) {
          this.optionss = Owner2.data;
        } else {
          this.$message.error(Owner.msg);
        }
        this.optionss.splice(0, 0, {
          nickName: "自己",
          userId: this.userId - 0,
        });
      };
         this.common(this.$route.query.proId - 0, tab.name);

      this.CodeSetting(tab.label, tab.name);
    },
    //公告弹窗
    AddAnnouncement(row) {
      //传递子组件当前的路由；然后调用子组件的事件函数
      this.uelLocation = window.location.pathname.slice(1);
      this.configTypeId = row;
      this.proId = this.$route.query.proId - 0;
      this.$refs.mychild.gitData();
    },

    //查看上级
    async otherExport(row) {
      // //console.log(row, "查看上级数据");
      this.SuperiorShow = true;
      const { data } = await selectByHierarchy({ userId: row.user_id - 0 });
      this.CheckSuperiorData = data;
      this.CheckSuperiorNumber = data.length - 1;
      // //console.log(this.CheckSuperiorNumber, "数字");
      // //console.log(data, "返回数据");
    },
    //查看上级关闭按钮
    onClose() {
      this.$refs["elForm"].resetFields();
    },
    // 码设置-下载模板按钮
    async upltemplate() {
      let param = (param = {
        proId: this.$route.query.proId - 0,
        configTypeId: this.tebleParam.name - 0, //脱敏是2  汇总是9
      });
      // if (this.$route.query.judgeParam - 0 == 1) {
      //   param = {
      //     proId: this.$route.query.proId - 0,
      //     configTypeId:2, //脱敏是2  汇总是9
      //   };
      // } else {
      //   param = {
      //     proId: this.$route.query.proId - 0,
      //     configTypeId: 9, //脱敏是2  汇总是9
      //   };
      // }
      // //console.log(param, "下载模板给后端传递的值");
      const res = await downLoadFormwork(param);

      var downloadUrl = window.URL.createObjectURL(res); //转换
      //添加一个a标签，利用a标签打开表格
      var anchor = document.createElement("a");
      anchor.href = downloadUrl;
      anchor.download = decodeURI("模板.xlsx");
      anchor.click();
    },

    // 码设置-批量划拨/回收下载模板按钮
    async downloadTemplate() {
      const res = await transferFormwork();
      var downloadUrl = window.URL.createObjectURL(res); //转换
      //添加一个a标签，利用a标签打开表格
      var anchor = document.createElement("a");
      anchor.href = downloadUrl;
      anchor.download = decodeURI("模板.xlsx");
      anchor.click();
    },

    handleMouseEnter() {},
    //单条划拨
    singletransfer() {
      this.$refs["transferData"].validate(async (valid) => {
        if (valid) {
          let param = {
            configTypeId: this.tebleParam.name - 0,
            idList: [this.temporary], //码ID集合
            proId: this.$route.query.proId - 0,
            receiveUserId: this.transferData.field102, //接收人ID
            state: this.transferData.field101, //向下1，向上4
            transferUserId: this.userId, //userID
          };
          // //console.log(param, "单条划拨");
          const data = await userTransfer(param);
          if (data.code == 200) {
            this.transferDialogVisible = false;
            this.$message({
              type: "success",
              message: "划拨成功!",
            });
            this.switchButton(); //更新页面
          }
          // //console.log(data, "单条划拨回调");
          // const data = await userTransfer(param);
        }
      });
    },
    //批量回收按钮
    async recoveryClick() {
      let param = {
        proId: this.$route.query.proId - 0,
        userId: this.userId,
        idList: this.variable,
      };
      const data = await tenantByRecovery(param);
      // //console.log(data, "批量回收后端得数据");
      if (data.code == 200) {
        this.recoveryVisible = false;
        this.switchButton(); //更新页面
        this.$message({
          type: "success",
          message: "操作成功!",
        });
      }
      this.variable = [];
      // //console.log("批量回收");
    },
    //批量向上向下划拨
    async transferschange() {
      // //console.log(this.transferData.field101, "划拨");
      // 1向下划拨  4向上
      switch (this.transferData.field101) {
        case 1:
          const lower = await selectUserGroupRelaList();
          // //console.log(lower, "向下划拨");
          if (lower.code == 200) {
            this.transferOptions = [
              {
                nickName: "",
                userId: null,
              },
            ];
            this.transferOptions = lower.data.groupRelaList;
            this.transferData.field102 = "";
          }
          break;
        case 4:
          const upper = await selectBySuperior({ userId: this.userId });
          // //console.log(upper, "向上划拨");
          if (upper.code == 200) {
            this.transferOptions = [
              {
                nickName: "",
                userId: null,
              },
            ];
            this.transferOptions[0].nickName = upper.data.nickName;
            this.transferOptions[0].userId = upper.data.userId;
            this.transferData.field102 = upper.data.userId;
            // //console.log(this.transferOptions, "00000000000++++++++++++++");
          }
          break;
      }
    },

    //脱敏数据重置按钮
    desensitizationReset(form, index) {
      //团队汇总搜索
      this.teamformData = {
        field103: "1",
        field102: [],
      };
      //会员汇总搜索
      this.memberformData = {
        field103: "1",
        field102: [],
      };
      //码汇总数据搜索
      this.summaryformData = {
        field102: [],
        field103: "",
        field104: "",
        field105: "1",
        field106: "",
      };
      this.SettingParam = {
        valueTime: [],
        cTime: "",
        eTime: "",
        id: "", //系统ID
        maBiaoShi: "", //广告位名称
        maLianJie: "", //广告位链接
        maName: "",
        proId: undefined,
        pageNum: 1,
        pageSize: 10,
        state: undefined, //已使用1,0未分配
        wbList: [], //文本集合
        userId: "1", //归属人
      };

      //  this.summaryformData.field102[0] =
      //     this.moment().format("YYYY") +
      //     "-" +
      //     this.moment().format("MM") +
      //     "-" +
      //     "01"+""+"00:00:00";
      //   this.summaryformData.field102[1] = this.moment().format("YYYY-MM-DD")+""+"23:59:59";

      //     this.summaryformData.field102[0] =
      //       this.moment().format("YYYY") +
      //       "-" +
      //       this.moment().format("MM") +
      //       "-" +
      //       "01";
      //     this.summaryformData.field102[1] = this.moment().format("YYYY-MM-DD");

      //     this.memberformData.field102[0] =
      //       this.moment().format("YYYY") +
      //       "-" +
      //       this.moment().format("MM") +
      //       "-" +
      //       "01";
      //     this.memberformData.field102[1] = this.moment().format("YYYY-MM-DD");
      //     this.teamformData.field102[0] =
      //       this.moment().format("YYYY") +
      //       "-" +
      //       this.moment().format("MM") +
      //       "-" +
      //       "01";
      //     this.teamformData.field102[1] = this.moment().format("YYYY-MM-DD");

      this.switchButton(1); //更新页面
      this.$refs[form].resetFields();
      // //console.log(index,'重置222');
    },

    //单条回收按钮
    editBotton(row) {
      // //console.log(row, "回收");
      this.$confirm("此操作将回收该数据, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(async () => {
          const array = [];
          array.push(row.id);

          let param = {
            proId: this.$route.query.proId - 0,
            userId: this.userId,
            idList: array,
          };
          // //console.log(param, "回收后端得数据");
          const data = await tenantByRecovery(param);
          // //console.log(data, "回收后端得数据");
          if (data.code == 200) {
            this.switchButton(); //更新页面
            this.$message({
              type: "success",
              message: "操作成功!",
            });
          }
        })
        .catch(() => {});
    },
    actionUrl() {
      return "";
    },
    //上传码按钮
    handleChange(file, fileList) {
      if (fileList.length > 1) {
        fileList.splice(0, 1);
      }

      let formData = new FormData();
      // formData.append("avatarfile", file.raw);
      formData.append("file", file.raw);
      formData.append("proId", this.$route.query.proId - 0);
      //脱敏是2  汇总是9
      formData.append("configTypeId", this.tebleParam.name - 0);
      // if(this.$route.query.judgeParam - 0 == 1){
      //    formData.append("configTypeId", 2);
      // }else{
      //    formData.append("configTypeId", 9);
      // }
      // 调用后端接口,file就是给后端的字段，可以更改
      uploadCode(formData).then((data) => {
        // //console.log(data, "222");
        if (data.code == 200) {
          this.$message({
            message: "上传成功!",
            type: "success",
          });
          this.uploadDialogVisible = false;
          this.switchButton(); //更新页面
        }
      });
    },
    //批量划拨上传按钮
    handleChange2(file, fileList) {
      if (fileList.length > 1) {
        fileList.splice(0, 1);
      }
      let formData = new FormData();
      // formData.append("avatarfile", file.raw);
      formData.append("file", file.raw);
      // 调用后端接口,file就是给后端的字段，可以更改
      uploadtransfer(formData).then((data) => {
        // //console.log(data, "222");
        if (data.code == 200) {
          this.$message({
            message: "上传成功!",
            type: "success",
          });
          this.variable = data.data;
        }
      });
    },
    //批量回收上传按钮
    handleChange3(file, fileList) {
      let formData = new FormData();
      // formData.append("avatarfile", file.raw);
      formData.append("file", file.raw);
      // 调用后端接口,file就是给后端的字段，可以更改
      // AlipayUpload(formData).then((data) => {
      //   //console.log(data, "222");
      // });
    },
    //上传码
    field101BeforeUpload() {
      let isRightSize = file.size / 1024 / 1024 < 2;
      if (!isRightSize) {
        this.$message.error("文件大小超过 2MB");
      }
      return isRightSize;
    },
    field103fileList() {},
    field103Action() {},
    field103BeforeUpload() {},
    //全选取消全选
    checkShow() {
      if (this.checkBox == 0) {
        this.roleList.map((row) => {
          row.remark = true;
        });
        this.checkBox = 1;
      } else {
        this.roleList.map((row) => {
          row.remark = false;
        });
        this.checkBox = 0;
      }
    },
    //划拨按钮
    async transferBotton(row) {
      // //console.log(this.transferData.field101, "单条划拨");
      // //console.log(row, "单条划拨222");
      this.temporary = row.id;
      if(this.transferData.field101==1){
        if(this.userName == "租户"){
          // //console.log(this.optionss,'划拨用户')
         this.transferOptions= this.optionss.filter(item=>item.nickName!='自己')
        }else{
           const lower = await selectUserGroupRelaList();
          // //console.log(lower, "向下划拨");
          if (lower.code == 200) {
            this.transferOptions = lower.data.groupRelaList;
          }
        }
        
      }else if(this.transferData.field101==4){
          const upper = await selectBySuperior({ userId: this.userId });
          // //console.log(upper, "向上划拨");
      }
     
      this.transferDialogVisible = true;
      this.transferData.field102 = "";
    },
    //批量划拨弹窗确定键
    transferClick() {
      this.$refs["transferData"].validate(async (valid) => {
        if (valid) {
          if (this.variable.length > 0) {
            let param = {
              idList: this.variable, //码ID集合
              proId: this.$route.query.proId - 0,
              receiveUserId: this.transferData.field102, //接收人ID
              state: this.transferData.field101, //向下1，向上4
              transferUserId: this.userId, //userID
              configTypeId: this.tebleParam.name - 0,
            };
            const data = await userTransfer(param);
            if (data.code == 200) {
              this.drawingVisible = false;
              this.$message({
                type: "success",
                message: "划拨成功!",
              });
              this.switchButton(); //更新页面
            } else {
              this.variable = [];
            }
            // //console.log(data, "批量划拨回调");
          } else {
            this.$message({
              message: "请上传模板文件!",
              type: "warning",
            });
          }
        }
      });
    },
    //码设置新增弹窗确定键
    addClick() {
      this.$refs["addrData"].validate(async (valid) => {
        if (valid) {
          let param = {
            proId: this.$route.query.proId - 0,
            userId: this.userId,
            codeName: this.addrData.field101,
            configTypeId: this.tebleParam.name - 0,
          };
          const data = await userNewCode(param);
          if (data.code == 200) {
            this.$message({
              message: "新增成功!",
              type: "success",
            });
            this.addDialogVisible = false;
            this.addrData.field101 = "";
            this.switchButton(); //更新页面
          } else {
            this.$message.error("操作失败!");
          }
          // //console.log(data, "回调");
        }
        // this.close();
      });
    },
    //快速新增弹窗确定键
    fastaddClick() {
      this.$refs["fastaddrData"].validate(async (valid) => {
        if (valid) {
          let param = {
            proId: this.$route.query.proId - 0,
            userId: this.userId,
            num: this.fastaddrData.field101,
            configTypeId: this.tebleParam.name - 0,
          };
          const data = await userNewCode(param);
          if (data.code == 200) {
            this.$message({
              message: "新增成功!",
              type: "success",
            });
            this.fastaddDialogVisible = false;
            this.fastaddrData.field101 = "";
            this.switchButton(); //更新页面
          } else {
            this.$message.error("操作失败!");
          }
          // //console.log(data, "回调");
        }
      });
    },
    //删除
    delBotton(row) {
      this.$confirm("此操作将删除, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(async () => {
          let param = {
            idList: [row.id],
            proId: this.$route.query.proId - 0,
          };
          const data = await deleteByIds(param);
          // //console.log(data, "删除");
          if (data.code == 200) {
            this.switchButton(); //更新页面
            this.$message({
              type: "success",
              message: "操作成功!",
            });
          }
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消",
          });
        });
    },
    //批量划拨
    async transfersBotton() {
      // //console.log(this.transferData.field101, "向上划拨");
      // 1向下划拨  4向上
      switch (this.transferData.field101) {
        case 1:
          const lower = await selectUserGroupRelaList();
          // //console.log(lower, "向下划拨");
          if (lower.code == 200) {
            this.transferOptions = lower.data.groupRelaList;
          }
          break;
        case 4:
          const upper = await selectBySuperior({ userId: this.userId });
          // //console.log(upper, "向上划拨");
          //  if(data.code==200){
          //    this.transferOptions=data.data.list;
          //  };
          break;
      }
      this.transferData.field102 = "";
      this.drawingVisible = true;
    },
    //查询
    selectByZD() {
      let data = {
        proId: this.proId,
        type: 0,
      };
      selectByZD(data).then((data) => {
        // //console.log(data.data);
        this.dataHeader = data;
        // for(var a=0;a<data.length;a++){
        //            this.tHeaders.push(data[a].bieName)
        //            this.filterVals.push(data[a].idName)
        //          }
      });
    },

    UploadUrl() {
      return "";
    },
    //
    SummaryButton() {
      this.$refs["elForm"].validate((valid) => {
        if (!valid) return;
        this.close();
      });
    },
    submitForm() {
      this.$refs["elForm"].validate((valid) => {
        if (!valid) return;
        // TODO 提交表单
      });
    },
    resetForm() {
      this.$refs["elForm"].resetFields();
    },

    resetForm(formName) {
      this.$refs[formName].resetFields();
    },

    /** 重置按钮操作 */
    resetQuery() {
      // //console.log(this.queryParams, "重置按钮");
      this.resetForm("queryForm");
      this.handleQuery();
    },
    /** 搜索按钮操作 */
    async handleQuery() {
      // //console.log(this.queryParams.dateRange, "时间");
      let param = {
        beginDate: this.queryParams.dateRange[0], //创建时间
        endDate: this.queryParams.dateRange[1],
        proId: this.queryParams.amountType,
        amountType: this.activeName,
      };
      const data = await selectCapPoolAccountRecordList(param);
      // //console.log(data, "搜索结果");
      this.roleList = data;
      this.total = data.length;

      const card = await capPoolAccountRecordStatistics(param);
      this.CardData = card;
      // //console.log(card, "获取卡片");

      if (this.activeName == "0") {
        // //console.log(this.queryParams, "佣金搜索按钮");
      } else if (this.activeName == "1") {
        // //console.log(this.queryParams, "分润搜索按钮");
      } else {
        // //console.log(this.queryParams, "其它搜索按钮");
      }

      // this.queryParams.pageNum = 1
    },
  },
  computed: {
    transferState() {
      if (this.variable.length > 0) {
        return true;
      } else {
        return false;
      }
    },
  },
};
</script>
<style scoped lang="scss">
//弹窗在屏幕中间
::v-deep .el-dialog__wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}
::v-deep .el-dialog:not(.is-fullscreen) {
  margin-top: 0vh !important;
}
//统计的便签
.LabelBox {
  // border: 1px red solid;
  margin-top: 10px;
  display: flex;

  align-items: flex-end;
  justify-content: space-between;
  .LabelMiniBox {
    bottom: 0px;
    width: 90%;
    height: 60px;
    // border: 1px red solid;
    display: flex;
    align-items: center;
    // margin-right: 10px;
    .LabelMiniBox_span {
      height: 100%;
      display: flex;
      padding-left: 5px;
      align-items: center;
      background: rgb(238, 238, 238);
      // margin-left: 5px;
    }
  }
}
.textBox {
  color: rgb(175, 175, 175);
}
.textBox2 {
  color: #538aff;
}
.dBox {
  margin: 0px auto;
  background: #ffffff;
  padding: 20px;
  border-radius: 7px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}
.xhxBox {
  border-top: 1px #eee solid;
  height: 5px;
  margin-top: 15px;
}

.el-card__header {
  width: 90%;
}
</style>
<style lang='scss'>
// .el-card__header{
//   border:none !important;
// }

.el-tabs__nav-wrap::after {
  // background: none;
  height: 0;
}
.xhxShow {
  border-bottom: 2px solid #538aff;
}
.el-tabs__item .is-top {
}
.xzxhx {
}
.topDiv {
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  padding: 20px;
  height: auto;
  .title {
    height: 50px;
    border-bottom: 1px solid #eee;
    display: flex;

    align-items: center;
    img {
      height: 30px;
      margin-right: 10px;
    }
  }
  .containers {
    height: 130px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    padding: 20px;
  }
}
</style>
